package com.heima.comment.controller.v1;

import com.heima.api.comment.CommentReplyControllerApi;
import com.heima.comment.service.CommentReplyService;
import com.heima.model.comment.dtos.CommentReplyDto;
import com.heima.model.comment.dtos.CommentReplyLikeDto;
import com.heima.model.comment.dtos.CommentReplySaveDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author admin
 */
@RestController
@RequestMapping("/api/v1/comment_repay")
public class CommentReplyController implements CommentReplyControllerApi {

    @Resource
    private CommentReplyService commentReplyService;

    @PostMapping("/load")
    @Override
    public ResponseResult loadCommentReply(@RequestBody CommentReplyDto dto){
        return commentReplyService.loadCommentReply(dto);
    }

    @PostMapping("/save")
    @Override
    public ResponseResult saveCommentReply(@RequestBody CommentReplySaveDto dto){
        return commentReplyService.saveCommentReply(dto);
    }

    @PostMapping("/like")
    @Override
    public ResponseResult saveCommentReplyLike(@RequestBody CommentReplyLikeDto dto){
        return commentReplyService.saveCommentReplyLike(dto);
    }

}